Skip to content

implement testing_buildBlockV1#9838

Merged
matkt merged 11 commits intobesu-eth:mainfrom
macfarla:testing-buildblockv1
Mar 5, 2026
Merged

implement testing_buildBlockV1#9838
matkt merged 11 commits intobesu-eth:mainfrom
macfarla:testing-buildblockv1

Conversation

@macfarla
Copy link
Copy Markdown
Contributor

PR description

related to #9832 which also introduces GenericBlockCreator
RpcMethod.java — Added TESTING_BUILD_BLOCK_V1("testing_buildBlockV1")

Refs a proposed JSON-RPC method, it introduces a new namespace specifically for testing and a new method testing_buildBlockV1 - there is a go-ethereum PR and OpenRPC specs, etc.
ethereum/execution-apis#710
ethereum/execution-apis#747
ethereum/go-ethereum#33656

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@jochem-brouwer
Copy link
Copy Markdown

Hiya! Does this also include support for Glamsterdam / BALs?

I will point in a comment later on how you can test this testing (lol) RPC endpoint for this specific method!

@matkt
Copy link
Copy Markdown
Contributor

matkt commented Feb 27, 2026

Hiya! Does this also include support for Glamsterdam / BALs?

I will point in a comment later on how you can test this testing (lol) RPC endpoint for this specific method!

I see that the implementation is using EngineNewPayloadV4 so normally not.

Signed-off-by: Karim Taam <karim.t2am@gmail.com>
@matkt
Copy link
Copy Markdown
Contributor

matkt commented Feb 27, 2026

@jochem-brouwer updated the PR it should be compatible with BAL, I also tested locally for the moment with some tests

@jochem-brouwer
Copy link
Copy Markdown

This is great, we need this endpoint implemented with BAL/Glamsterdam support to start benchmarking BALs on top of state to get real numbers for BAL optimizations. For this we need one client to "fill" these tests (on top of state).

Thanks a lot for this! We'll check it out to see if we can fill these state tests with BALs

@macfarla macfarla mentioned this pull request Mar 3, 2026
10 tasks
@macfarla macfarla self-assigned this Mar 4, 2026
macfarla added 2 commits March 5, 2026 07:20
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla macfarla marked this pull request as ready for review March 5, 2026 02:12
Copilot AI review requested due to automatic review settings March 5, 2026 02:12
@macfarla macfarla added the RPC label Mar 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the proposed testing_buildBlockV1 JSON-RPC method under a new TESTING API group, along with supporting block-creation logic and spec/fixture tests.

Changes:

  • Adds testing_buildBlockV1 RPC method, parameter model, and API group wiring.
  • Introduces a specialized TestingBlockCreator and updates payload result ordering to include BAL/slot fields.
  • Adds integration/unit/spec tests plus chain-data fixtures for testing_buildBlockV1.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/TestingBuildBlockIntegrationTest.java Adds block-creation integration tests validating BAL presence/absence and structure.
ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/GenericBlockCreator.java Updates file header copyright text.
ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/testing_buildBlockV1/chain-data/genesis.json Adds genesis fixture for testing_buildBlockV1 JSON-RPC by-spec tests.
ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/testing_buildBlockV1/*.json Adds JSON-RPC by-spec request/response fixture cases for testing_buildBlockV1.
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/testing/TestingBuildBlockV1Test.java Adds unit tests for TestingBuildBlockV1 validations and BAL encoding.
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/TestingBuildBlockJsonRpcHttpBySpecTest.java Adds Bonsai HTTP by-spec test runner for the new method.
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java Enables TESTING RPC API and mocks extra mining/tx-selection dependencies.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/TestingJsonRpcMethods.java Introduces a new JSON-RPC API group for testing-only methods.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.java Wires TestingJsonRpcMethods into the methods factory.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV6.java Adds explicit JSON property order for payload serialization including BAL/slot fields.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TestingBuildBlockParameter.java Adds request parameter model (parent hash, payload attributes, txs, extraData).
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/testing/TestingBuildBlockV1.java Implements the testing_buildBlockV1 JSON-RPC method end-to-end.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/testing/TestingBlockCreator.java Adds a testing-oriented block creator used by testing_buildBlockV1.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java Registers new enum entry TESTING_BUILD_BLOCK_V1.

matkt and others added 3 commits March 5, 2026 11:51
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
@macfarla macfarla assigned daniellehrner and unassigned macfarla Mar 5, 2026
@@ -0,0 +1,104 @@
/*
* Copyright contributors to Hyperledger Besu.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should drop the Hyperledger

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a gap in the numbering in the filenames. We go from 4 to 6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a gap on my side.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@daniellehrner daniellehrner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left 2 comments about dropping Hyperldeger from the copyright and a gap in the testfile numbering. The rest looks okay

matkt added 2 commits March 5, 2026 15:33
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
@matkt matkt enabled auto-merge (squash) March 5, 2026 12:03
@matkt matkt merged commit 69d1c18 into besu-eth:main Mar 5, 2026
46 checks passed
@macfarla macfarla deleted the testing-buildblockv1 branch March 5, 2026 21:50
qu0b pushed a commit to qu0b/besu that referenced this pull request Mar 16, 2026
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
qu0b pushed a commit to qu0b/besu that referenced this pull request Mar 16, 2026
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: qu0b <stefan@starflinger.eu>
macfarla added a commit that referenced this pull request Mar 17, 2026
* TESTING api group allowed (#9946)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: qu0b <stefan@starflinger.eu>

* implement testing_buildBlockV1 (#9838)

Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: qu0b <stefan@starflinger.eu>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: qu0b <stefan@starflinger.eu>
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants